package com.boot.notes;

import org.apache.commons.lang.StringUtils;

/**
 * @BelongsProject: springboot
 * @BelongsPackage: com.boot.notes
 * @Author: meikaiqiang
 * @CreateTime: 2022-08-10  09:29
 * @Description: TODO
 * @Version: 1.0
 */
public class AuthMy {

    public boolean permitAll() {
        return true;
    }

    public boolean denyAll() {
        return this.hasRole("administrator");
    }

    public boolean hasRole(String role) {
        return this.hasAnyRole(role);
    }

    public boolean hasAnyRole(String... role) {
        String userRole = "2,3,1,7";
        if (StringUtils.isBlank(userRole)) {
            return false;
        } else {
            System.out.println("juese**********");

            return false;
        }
    }

    public boolean hasPermission(String permission) {
        System.out.println("权限比较--------------------------------------");
        return "aaa".equals(permission);
    }
}
